<%@ page language="Java" import="java.util.*"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	request.setCharacterEncoding("UTF-8");
%>

<%
boolean isLogin = false;
try{
	isLogin = (boolean) request.getSession().getAttribute("isLogin");
	}catch(Exception e){
		
	}

	if (isLogin != false) {
%>



<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
	content="Creative - Bootstrap 3 Responsive Admin Template">
<meta name="author" content="GeeksLabs">
<meta name="keyword"
	content="Creative, Dashboard, Admin, Template, Theme, Bootstrap, Responsive, Retina, Minimal">
<link rel="shortcut icon" href="img/favicon.png">

<title>Manager</title>

<!-- Bootstrap CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- bootstrap theme -->
<link href="css/bootstrap-theme.css" rel="stylesheet">
<!--external css-->
<!-- font icon -->
<link href="css/elegant-icons-style.css" rel="stylesheet" />
<link href="css/font-awesome.min.css" rel="stylesheet" />
<!-- date picker -->

<!-- color picker -->

<!-- Custom styles -->
<link href="css/style.css" rel="stylesheet">
<link href="css/style-responsive.css" rel="stylesheet" />

<!-- HTML5 shim and Respond.js IE8 support of HTML5 -->
<!--[if lt IE 9]>
      <script src="js/html5shiv.js"></script>
      <script src="js/respond.min.js"></script>
      <script src="js/lte-ie7.js"></script>
    <![endif]-->

</head>

<body>

	<!-- container section start -->
	<section id="container" class="">
		<!--header start-->
		<header class="header dark-bg">
			<div class="toggle-nav">
				<div class="icon-reorder tooltips"
					data-original-title="Toggle Navigation" data-placement="bottom">
					<i class="icon_menu"></i>
				</div>
			</div>

			<!--logo start-->
			<a href="index.html" class="logo">Nice <span class="lite">Admin</span></a>
			<!--logo end-->

			<div class="nav search-row" id="top_menu">
				<!--  search form start -->
				<ul class="nav top-menu">
					<li>
						<form class="navbar-form">
							<input class="form-control" placeholder="Search" type="text">
						</form>
					</li>
				</ul>
				<!--  search form end -->
			</div>
			<div class="top-nav notification-row">
				<ul class="nav pull-right top-menu">

					<!-- user login dropdown start-->
					<li class="dropdown"><a data-toggle="dropdown"
						class="dropdown-toggle" href="#"> <span class="profile-ava">
								<img alt="" src="img/avatar1_small.jpg">
						</span> <span class="username">${sessionScope.username}</span> <b class="caret"></b>
					</a>
						<ul class="dropdown-menu extended logout">
							<div class="log-arrow-up"></div>
							<li><a href="../Logout"><i class="icon_key_alt"></i>
									Log Out</a></li>
						</ul></li>
					<!-- user login dropdown end -->
				</ul>
				<!-- notificatoin dropdown end-->
		</header>
		<!--header end-->

		<!--sidebar start-->
		<aside>
			<div id="sidebar" class="nav-collapse ">
				<!-- sidebar menu start-->
				<ul class="sidebar-menu">
					<li class="active"><a class="" href="#"> <i
							class="icon_house_alt"></i> <span>^_^</span>
					</a></li>
					<li><a class="" href="#"> <i class="icon_genius"></i> <span>写点啥</span>
					</a></li>
					<li><a class="" href="ListArticles"> <i class="icon_piechart"></i> <span>浏览文章</span>
					</a></li>
					<li><a class="" href="#"> <i class="icon_genius"></i> <span>修改文章</span>
					</a></li>
					<li><a class="" href="#"> <i class="icon_piechart"></i> <span>删除文章</span>
					</a></li>


				</ul>
				<!-- sidebar menu end-->
			</div>
		</aside>
		<!--sidebar end-->

		<!--main content start-->
		<section id="main-content">
			<section class="wrapper">
				<div class="row">
					<div class="col-lg-12">
						<h3 class="page-header">
							<i class=""></i> 写文章,咯^_^
						</h3>
					</div>
				</div>
				<div class="row">
					<div class="col-lg-12">
						<div class="panel-body">
							<form class="form-horizontal" id="aForm" method="post">
								<label class="col-sm-2">标题</label>
								<div class="form-group">
									<!-- <label class="col-sm-2 control-label">标题</label> -->
									<div class="col-sm-12">
										<input type="text" id="title" class="form-control round-input" value="${article.title}">
									</div>
								</div>
								<label class="col-sm-2">概要</label>
								<div class="form-group">
									<!-- <label class="col-sm-2 control-label">概要</label> -->
									<div class="col-sm-12">
										<input type="text" id="ac_abstract"
											class="form-control round-input" value="${article.ac_abstract}">
									</div>
								</div>
								<label class="col-sm-2">正文</label>
								<div class="form-group">
									<!-- <label class="col-sm-2 control-label">正文</label> -->
									<div style="width: 100%" class="col-sm-12">
										<!--用当前元素来控制高度-->
										<div id="editor_div" style="height: 400px; max-height: 500px;">
											${article.content}
										</div>
									</div>
								</div>
								<div class="form-group">
									<div class="col-lg-4" style="">
										<label></label>
									</div>
									<div class="col-lg-4" style="">
										<label></label>
									</div>
									<div class="col-lg-4" style="">
										<button class="btn btn-primary btn-lg btn-block">保存</button>
									</div>

								</div>
							</form>
						</div>

					</div>
				</div>

			</section>
		</section>
		<!--main content end-->

	</section>
	<!-- container section end -->
	<!-- javascripts -->
	<script src="js/jquery.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<!-- nice scroll -->
	<script src="js/jquery.scrollTo.min.js"></script>
	<script src="js/jquery.nicescroll.js" type="text/javascript"></script>

	<!-- jquery ui -->
	<script src="js/jquery-ui-1.9.2.custom.min.js"></script>

	<!--custom checkbox & radio-->
	<script type="text/javascript" src="js/ga.js"></script>
	<!--custom switch-->
	<script src="js/bootstrap-switch.js"></script>
	<!--custom tagsinput-->
	<script src="js/jquery.tagsinput.js"></script>

	<!-- colorpicker -->

	<!-- bootstrap-wysiwyg -->
	<script src="js/jquery.hotkeys.js"></script>
	<script src="js/bootstrap-wysiwyg.js"></script>
	<script src="js/bootstrap-wysiwyg-custom.js"></script>

	<!-- custom form component script for this page-->
	<script src="js/form-component.js"></script>
	<!-- custome script for all page -->
	<script src="js/scripts.js"></script>


	<!--引入wangEditor.css-->
	<link rel="stylesheet" type="text/css"
		href="blogManager/editor/dist/css/wangEditor.min.css">

	<!--引入jquery和wangEditor.js-->
	<!--注意：javascript必须放在body最后，否则可能会出现问题-->
	<script type="text/javascript" src="blogManager/editor/dist/js/wangEditor.min.js"></script>

	<!--引入 xss.js 文件-->
	<script src="blogManager/editor/xss.js"></script>
</body>

<!--这里引用jquery和wangEditor.js-->
<script type="text/javascript">
	var editor = new wangEditor('editor_div');
	editor.create();
	
	

	$(document).ready(function() {
		$("button").click(function() {
			$.post("/Blog/EditArticle", {
				title : $('#title').val(),
				ac_abstract : $('#ac_abstract').val(),
				content : editor.$txt.html()
			}, function(data, status) {
				console.log("数据: \n" + data + "\n状态: " + status);
			});
		});
	});
</script>


</html>

<%
	} else {
		response.sendRedirect("../login");
	}
%>


